//百宝箱
// export const appId = 'wx6eca5acf47dd808c';
//wowo学车
export const appId = 'wx45911b9cce357e56';

//获取当前小程序版本类型，设置请求域名地址
export let appRequestUrl = ''
const accountInfo = wx.getAccountInfoSync()
var envVersion = accountInfo.miniProgram.envVersion;
switch (envVersion) {
  case 'develop'://开发版'https://web.uat.szctjt.cn'
    appRequestUrl = 'https://web.uat.szctjt.cn'
    break;
  case 'trial'://体验版 
    appRequestUrl ='https://web.uat.szctjt.cn'
    break;
  case 'release'://正式版
    appRequestUrl = 'https://drive-api.chexinlian.com'
    break;
  default:
    break;
}


//毕业周期
export const graduationCycle = [
  { classNumber: 'TEA', time: 60, text: '基础班', type: ['C1', 'C2'] },
  { classNumber: 'TG', time: 60, text: '精品班', type: ['C1', 'C2'] },
  { classNumber: 'VP', time: 60, text: '贵宾班', type: ['C1', 'C2'] },
]


//分享设置
export const shareAppMessageSet = () => {
  const userInfo = wx.getStorageSync('userInfo')
  return {
    title: '学车咨询，驾考攻略，WoWo一下全搞定',
    path: userInfo ? ('/pages/index/index?nickname=' + userInfo.nickname + '&phone=' + userInfo.phone) : '/pages/index/index',
    imageUrl: 'https://static.pub-drive.chexinlian.com/wxmini/b1eea4d89e96edfa',
  }
}

//默认配置
export const defaultConfig = {
  //默认的跳转客服地址
  customerServiceUrl: 'https://work.weixin.qq.com/kfid/kfcc3e40c863834fe97',
  //默认的客服电话
  customerServiceTel: '13480907613',
  //登录页默认的驾校logo（深港）
  loginLogo: 'http://static.pri-drive.chexinlian.com/school/9b4470b412d5f63c?e=1721719550&token=yyCOzunYfh_0BqCLQ3Ut0D9sl-SAyjED_qtesIOH:c4pq1Lh2AE0EMPkGk08mWu7Jm6U=',
  //默认的驾校logo（深港）
  logo:'http://static.pri-drive.chexinlian.com/school/c016dcd9db1e833f?e=1721719550&token=yyCOzunYfh_0BqCLQ3Ut0D9sl-SAyjED_qtesIOH:rSMJAg4a-Y523plcaleE7Relu8A=',
  //默认的驾校名称（深港驾校）
  shortName:'深港驾校'
}

//打开客服
export const openServer = (parmas?: { showMessageCard: boolean, sendMessageTitle: string, sendMessagePath: string, sendMessageImg: string }) => {
  wx.openCustomerServiceChat(
    {
      corpId: 'ww0e4fff13b261a34f',
      extInfo: {
        url: wx.getStorageSync('currentDrivingSchool').customerServiceUrl ?? defaultConfig.customerServiceUrl
      },
      ...parmas,
      success: (res: any) => {
        console.log('成功', res)
      },
      fail: (res: any) => {
        console.log('失败', res)
      }
    }
  )
}
